import { IStoreHome } from "~/types";
type TAcion = {
  commit:(type:string,payload:object)=>void;
  state:IStoreHome
}
export const state=function():IStoreHome{
  return {
    err:1,
    data:[]
  }
}

export const mutations = {
  M_UPDATE_HOME(state:IStoreHome,payload:IStoreHome){
    state.err=payload.err;
    state.data=payload.data;
  }
}

export const actions = {
  A_UPDATE_HOME({commit,state}:TAcion,payload:IStoreHome){
    //异步处理
    commit('M_UPDATE_HOME',{err:0,data:{title:"home 模块 actions所传递的数据"}})
  }
}